package com.wanmait.wanmarecruit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wanmait.wanmarecruit.entity.CompanyPic;
import com.wanmait.wanmarecruit.mapper.CompanyPicMapper;
import com.wanmait.wanmarecruit.service.CompanyPicService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class CompanyPicServiceImpl extends ServiceImpl<CompanyPicMapper, CompanyPic> implements CompanyPicService {

    @Resource
    private CompanyPicMapper companyPicMapper;
    @Override
    public List<CompanyPic> getCompanyPicByCompanyId(Integer companyId) {
        return companyPicMapper.selectCompanyPicByCompanyId(companyId);
    }

    @Override
    public void removePicByCompanyId(Integer companyId) {
        LambdaQueryWrapper<CompanyPic> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CompanyPic::getCompanyId,companyId);
        this.remove(queryWrapper);
    }

}
